package com.ad_hccm.dao;

import com.ad_hccm.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 医生Dao
 */
@Mapper
public interface UserDao {
    @Insert("insert into user value(#{account}, #{password}, #{id}, #{name}, #{role}, #{email}, #{avatar} )")
    public boolean save(User domain);

    @Update("update user set password = #{password}, name = #{name}, id = #{id}, email = #{email}, avatar = #{avatar} where account = #{account}")
    public boolean update(User domain);

    @Select("select * from user where account = #{account}")
    public User getByAccount(String account);

    @Select("select * from user")
    public List<User> getAll();

}
